class Phase < ActiveRecord::Base
 
  has_many :activities
  has_many :patterns_phases
  has_many :patterns, :through =>:patterns_phases
  has_many :projects, :through => :activities
  has_many :tasks
  belongs_to :project
  # Used for distributing budget for each phase.
  def weight_in_fee(project, weight)
    ((project.fee.to_i * weight) / 100)
  end
end